package com.glacier.yuyuan.gen.webapp.service.impl;

import com.glacier.common.support.service.impl.BaseServiceImpl;
import com.glacier.yuyuan.gen.webapp.domain.GenFieldType;
import com.glacier.yuyuan.gen.webapp.mapper.GenFieldTypeMapper;
import com.glacier.yuyuan.gen.webapp.service.GenFieldTypeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * date 2023-01-28 21:59
 * 字段类型管理 业务层
 *
 * @author glacier
 * @version 1.0.0
 */
@Transactional(readOnly = true)
@Service
public class GenFieldTypeServiceImpl extends BaseServiceImpl<GenFieldTypeMapper, GenFieldType>
        implements GenFieldTypeService {
    public GenFieldTypeServiceImpl() {
        super(GenFieldTypeMapper.class);
    }

    /**
     * 根据数据库类型查找字段类型
     *
     * @param dbType
     * @return
     */
    @Override
    public List<GenFieldType> findByDbType(String dbType) {
        GenFieldType fieldType = new GenFieldType();
        fieldType.setDbType(dbType);
        return mapper.findList(fieldType);
    }
}
